import com.lzh.dao.UserMapper;
import com.lzh.pojo.User;
import com.lzh.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class UserDebug {
    @Autowired
    private UserService userService;

    @Test
    public void find (){
        User lzh = userService.login("lzh","123456");
        if (lzh == null){
            System.out.println("查不到");
        }else{
            System.out.println("username:"+lzh.getUsername()+"   "+"password:"+lzh.getPassword());
        }
    }
    @Test
    public void findbyid(){
        User user1 = userService.selectbyid(1);
        System.out.println(user1);
    }
}
